package xna.android;

public class Block implements GameObjects
{	
	private SpriteAnimated spriteBlock;
	private int width;
	private int height;
	private String color;
	
	public Block(SpriteAnimated spriteBlock, String color)
	{
		this.spriteBlock = spriteBlock;
		this.width = spriteBlock.getSourceRect().width();
		this.height = spriteBlock.getSourceRect().height();
		this.color = color;
		
		if(color == "magenta") {
			spriteBlock.getSourceRect().left = this.width;
			spriteBlock.getSourceRect().right = 2*this.width;
		} else if (color == "yellow") {
			spriteBlock.getSourceRect().left = 2*this.width;
			spriteBlock.getSourceRect().right = 3*this.width;
		} else if (color == "green") {
			spriteBlock.getSourceRect().left = 3*this.width;
			spriteBlock.getSourceRect().right = 4*this.width;
		}
	}
	
	public SpriteAnimated getSpriteBlock() {
		return spriteBlock;
	}

	public void setSpriteBlock(SpriteAnimated spriteBlock) {
		this.spriteBlock = spriteBlock;
	}

	public int getX() 
	{
		return spriteBlock.getX();
	}

	public void setX(int x) 
	{
		spriteBlock.setX(x);
	}

	public int getY() 
	{
		return spriteBlock.getY();
	}

	public void setY(int y) 
	{
		spriteBlock.setY(y);
	}

	public int getWidth() 
	{
		return this.width;
	}

	public int getHeight() 
	{
		return this.height;
	}

	public String getCor() {
		return color;
	}

	public void setCor(String cor) {
		this.color = cor;
	}
}
